import java.util.Arrays;

public class Solution {
    public static void main(String[] args) {
        int[] nums = {3, 3};
        int target = 6;
        int[] ints = twoSum(nums, target);
        System.out.println(Arrays.toString(ints));
    }

    public static int[] twoSum(int[] nums, int target) {
        int[] result = new int[2];
        result[1] = -1;
        result[0] = -1;
        outer:
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = i + 1; j < nums.length; j++) {
                if (nums[i] + nums[j] == target) {
                    if (i != j) {
                        result[0] = i;
                        result[1] = j;
                        break outer;
                    }
                }
            }
        }
        return result;
    }
}
